﻿<UserControl x:Class="Tisbi.LawFirm.UI.Views.Controls.AppealsGreed"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mui="http://firstfloorsoftware.com/ModernUI"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="600">
    <Grid DataContext="{Binding Source={StaticResource Locator}, Path=AppealsViewModel}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="50" MaxWidth="50" />
            <ColumnDefinition Width="50" MaxWidth="50" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <mui:ModernButton Command="{Binding CreateCommand}" Grid.Row="0" Grid.Column="0" EllipseDiameter="22" HorizontalAlignment="Left" EllipseStrokeThickness="2" IconWidth="12" IconHeight="12" ToolTip="Добавить" IconData="{StaticResource AddIconData}" Width="34" />
        <mui:ModernButton Command="{Binding EditCommand}"  Grid.Row="0" Grid.Column="1" EllipseDiameter="22" HorizontalAlignment="Left" EllipseStrokeThickness="2" IconWidth="12" IconHeight="12" ToolTip="Редактировать" IconData="{StaticResource EditIconData}" Width="34" />
        <mui:ModernButton Command="{Binding RemoveCommand}" Grid.Row="0" Grid.Column="2" EllipseDiameter="22" HorizontalAlignment="Left" EllipseStrokeThickness="2" IconWidth="12" IconHeight="12" ToolTip="Удалить" IconData="{StaticResource RemoveIconData}" Width="34" />
        <mui:BBCodeBlock Visibility="{Binding HasVarnings}" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" Foreground="Red" Margin="5" BBCode="{Binding Varnings}" />

        <StackPanel Grid.Row="1" Grid.ColumnSpan="3" Grid.Column="0" >
            <ScrollViewer>
                <DataGrid AutoGenerateColumns="False" IsReadOnly="True"
                      ItemsSource="{Binding Model}"
                      SelectedItem="{Binding SelectedModelItem, Mode=TwoWay}">
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Path=Id}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="№" />
                        <DataGridTextColumn Binding="{Binding Path=AppealsType}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Тип жалобы" />
                        <DataGridTextColumn Binding="{Binding Path=Title}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Название" />
                        <DataGridTextColumn Binding="{Binding Path=HearingDate}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Дата рассмотения" />
                        <DataGridTextColumn Binding="{Binding Path=Court.Title}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Место рассмотения" />
                        <DataGridTextColumn Binding="{Binding Path=ResultOffAppeals}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Результат рассмотения" />
                    </DataGrid.Columns>
                </DataGrid>
            </ScrollViewer>
        </StackPanel>
    </Grid>
</UserControl>
